<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('体检医院列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="col-sm-12 search-collapse ifcomebody1">
        <form id="formId">
            <div class="select-list">
                <ul>
                    <li>
                        <label>医院名称 </label>
                        <input type="text" name="name" placeholder="请输入医院名称"/>
                    </li>
                    <li>
                        <a class="btn btn-chongzhi btn-rounded mr16 btn-sm" onclick="$.form.reset()">重置</a>
                        <a class="btn btn-chaxun  mr16 btn-rounded btn-sm" onclick="$.table.search()">查询</a>
                    </li>
                </ul>
            </div>
        </form>
    </div>

    <div class="btn-group-sm" style="display: flex;" id="toolbar" role="group">
        <a class="btn btn-dataadd" onclick="$.operate.add()" shiro:hasPermission="ydz:examinationHospital:add">
            <i class="fa fa-plus"></i> 添加
        </a>
        <a class="btn btn-newadd single disabled" onclick="$.operate.edit()"
           shiro:hasPermission="ydz:examinationHospital:edit">
            <i class="fa fa-edit"></i> 修改
        </a>
        <a class="btn btn-newadd multiple disabled" onclick="$.operate.removeAll()"
           shiro:hasPermission="ydz:examinationHospital:remove">
            <i class="fa fa-remove"></i> 删除
        </a>
        <a class="btn btn-newadd" onclick="$.table.exportExcel()" shiro:hasPermission="ydz:examinationHospital:export">
            <i class="fa fa-download"></i> 导出
        </a>
    </div>
    <div class="col-sm-12 select-table table-striped ifcomebody">
        <table id="bootstrap-table"></table>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('ydz:examinationHospital:edit')}]];
    var removeFlag = [[${@permission.hasPermi('ydz:examinationHospital:remove')}]];
    var prefix = ctx + "ydz/examinationHospital";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "体检医院",
            sortName: "update_time",
            sortOrder: "DESC",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '${comment}',
                    visible: false
                },
                {
                    field: 'name',
                    title: '医院名称'
                },
                {
                    field: 'description',
                    title: '描述',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value, 20);
                    }
                },
                {
                    field: 'keywords',
                    title: '关键词',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value, 20);
                    }
                },
                {
                    field: 'updateName',
                    title: '更新人名称'
                },
                {
                    field: 'updateTime',
                    title: '更新时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-caozuo btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')">编辑</a> ');
                        actions.push('<a class="btn btn-caozuo btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')">删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>